define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {

    var Controller = {
        index: function () {
            $(document).on("click", ".btn-embossed", function () {
                // 执行页面跳转
                window.location.href = "/general/profile";
            });


            // 检查添加成功的标记
            if (typeof add_success !== 'undefined' && add_success) {
                // 添加成功，执行跳转
                window.location.href = 'general/profile'; // 这里替换成你要跳转的页面的 URL
            }
            Controller.api.bindevent();
        },
        add: function () {
            Controller.api.bindevent();
        },
        edit: function () {
            Controller.api.bindevent();
        },
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            }
        }
    };
    return Controller;
});
